<?php
class Application_Model_Category extends Zend_Db_Table_Abstract 
{
    protected $_name = 'categories';
    
    public function getAllCategories() {
        $select = $this->select()
                       ->from($this->_name);
        return $this->fetchAll($select)->toArray();
    }
    
    public function addCategory($data) {
        $this->insert($data);
    }
    
    public function getSelectCategory($id) {
        $select = $this->select()
                       ->from($this->_name)
                       ->where('id =?', intval($id));
        return $this->fetchAll($select)->toArray();
    }
    
    public function updateSelectCategory($id, $data) {
        $this->update($data, 'id ='.intval($id));
    }
    
    public function deleteSelectCategory($id) {
        $this->delete('id ='.intval($id));
    }
    
    
}
?>
